//
//  LSCommonConstant.h
//  LiveStar
//
//  Created by 漪珊 on 2016/12/13.
//  Copyright © 2016年 apple. All rights reserved.
//

#ifndef LSCommonConstant_h
#define LSCommonConstant_h

//屏宽高宏
#define kSCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define kSCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

#define kTABBAE_HEIGHT 49
#define kNAV_HEIGHT 64

//判断手机机型
#define IPHONE_4  (([UIScreen mainScreen].bounds.size.width == 320) && ([UIScreen mainScreen].bounds.size.height == 480))
#define IPHONE_5_5s  (([UIScreen mainScreen].bounds.size.width == 320) && ([UIScreen mainScreen].bounds.size.height == 568))
#define IPHONE_6_6s_7  ([UIScreen mainScreen].bounds.size.width == 375) && ([UIScreen mainScreen].bounds.size.height == 667)
#define IPHONE_6P_6sP_7P  ([UIScreen mainScreen].bounds.size.width == 414) && ([UIScreen mainScreen].bounds.size.height == 736)

// 字体大小
#define UIFont(x) [UIFont systemFontOfSize:x]

//字符串转换
#define KString(string) [NSString stringWithFormat:@"%@", string]
#define KNum(Num) [NSString stringWithFormat:@"%u", Num]

// 缩放比
#define kScale ([UIScreen mainScreen].bounds.size.width) / 375

//RGB
#define kRGB(r, g, b, a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
#define HESHEX_COLOR(c) [UIColor colorWithHexString:c]

// View 圆角和加边框
#define kViewBorderRadius(View, Radius, Width, Color)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]]

// View 圆角
#define kViewRadius(View, Radius)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES]

// ImageView 圆角
#define kImageViewRadius(ImageView, Radius)\
\
[ImageView.layer setCornerRadius:(Radius)];\
[ImageView.layer setMasksToBounds:YES]
//ImageView 圆角 边框
#define kImageBorderRadius(ImageView, Radius, Width, Color)\
\
[ImageView.layer setCornerRadius:(Radius)];\
[ImageView.layer setMasksToBounds:YES];\
[ImageView.layer setBorderWidth:(Width)];\
[ImageView.layer setBorderColor:[Color CGColor]]

// button 圆角
#define kButtonRadius(button, Radius)\
\
[button.layer setCornerRadius:(Radius)];\
[button.layer setMasksToBounds:YES]

// button 圆角 边框
#define kButtonBorderRadius(Button, Radius, Width, Color)\
\
[Button.layer setCornerRadius:(Radius)];\
[Button.layer setMasksToBounds:YES];\
[Button.layer setBorderWidth:(Width)];\
[Button.layer setBorderColor:[Color CGColor]]

// label 圆角
#define kLabelRadius(label, Radius)\
\
[label.layer setCornerRadius:(Radius)];\
[label.layer setMasksToBounds:YES]


//全局颜色
#define kBlack kRGB(28.00f, 28.00f, 28.00f, 1.00f)

#define kGrayBackGround kRGB(51.00f, 51.00f, 51.00f, 1.00f)

#define kFontColor kRGB(161.00f, 161.00f, 161.00f, 1.00f)

#define kLightGrayBack kRGB(249.00f, 249.00f, 249.00f, 1.00f)

#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 \
alpha:1.0]

#define kSET_IMAGE(image) [UIImage imageNamed:image]

//占位图
#define kPlACE_ICON [UIImage imageNamed:@"Icon_PlaceholderImage"]
#define kPLACE_MID [UIImage imageNamed:@"picture_placeholder"]
#define kPLACE_BIG [UIImage imageNamed:@"starHome_placeholder"]

//评论列表
#define kAvatar_Size 40
#define kGAP 10
#endif /* LSCommonConstant_h */
